package com.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.dao.FendianxinxiDao;
import com.entity.FendianxinxiEntity;
import com.entity.view.FendianxinxiView;
import com.entity.vo.FendianxinxiVO;
import com.service.FendianxinxiService;
import com.utils.PageUtils;
import com.utils.Query;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("fendianxinxiService")
public class FendianxinxiServiceImpl extends ServiceImpl<FendianxinxiDao, FendianxinxiEntity> implements FendianxinxiService {
	
	
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page<FendianxinxiEntity> page = this.selectPage(
                new Query<FendianxinxiEntity>(params).getPage(),
                new EntityWrapper<FendianxinxiEntity>()
        );
        return new PageUtils(page);
    }
    //..
    @Override
	public PageUtils queryPage(Map<String, Object> params, Wrapper<FendianxinxiEntity> wrapper) {
		  Page<FendianxinxiView> page =new Query<FendianxinxiView>(params).getPage();
	        page.setRecords(baseMapper.selectListView(page,wrapper));
	    	PageUtils pageUtil = new PageUtils(page);
	    	return pageUtil;
 	}
    
    @Override
	public List<FendianxinxiVO> selectListVO(Wrapper<FendianxinxiEntity> wrapper) {
 		return baseMapper.selectListVO(wrapper);
	}
	
	@Override
	public FendianxinxiVO selectVO(Wrapper<FendianxinxiEntity> wrapper) {
 		return baseMapper.selectVO(wrapper);
	}
	
	@Override
	public List<FendianxinxiView> selectListView(Wrapper<FendianxinxiEntity> wrapper) {
		return baseMapper.selectListView(wrapper);
	}

	@Override
	public FendianxinxiView selectView(Wrapper<FendianxinxiEntity> wrapper) {
		return baseMapper.selectView(wrapper);
	}


}
